package com.xydtech.workflow.service.impl;

import com.xydtech.common.core.text.Convert;
import com.xydtech.workflow.domain.WflStepskip;
import com.xydtech.workflow.mapper.WflStepskipMapper;
import com.xydtech.workflow.service.IWflStepskipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 流程节点跳过条件配置Service业务层处理
 *
 * @author JHON
 * @date 2021-06-02
 */
@Service
public class WflStepskipServiceImpl implements IWflStepskipService {
    @Autowired
    private WflStepskipMapper wflStepskipMapper;

    /**
     * 查询流程节点跳过条件配置
     *
     * @param conditionId 流程节点跳过条件配置ID
     * @return 流程节点跳过条件配置
     */
    @Override
    public WflStepskip selectWflStepskipById(Long conditionId) {
        return wflStepskipMapper.selectWflStepskipById(conditionId);
    }

    /**
     * 查询流程节点跳过条件配置列表
     *
     * @param wflStepskip 流程节点跳过条件配置
     * @return 流程节点跳过条件配置
     */
    @Override
    public List<WflStepskip> selectWflStepskipList(WflStepskip wflStepskip) {
        return wflStepskipMapper.selectWflStepskipList(wflStepskip);
    }

    /**
     * 新增流程节点跳过条件配置
     *
     * @param wflStepskip 流程节点跳过条件配置
     * @return 结果
     */
    @Override
    public int insertWflStepskip(WflStepskip wflStepskip) {
        return wflStepskipMapper.insertWflStepskip(wflStepskip);
    }

    /**
     * 修改流程节点跳过条件配置
     *
     * @param wflStepskip 流程节点跳过条件配置
     * @return 结果
     */
    @Override
    public int updateWflStepskip(WflStepskip wflStepskip) {
        return wflStepskipMapper.updateWflStepskip(wflStepskip);
    }

    /**
     * 删除流程节点跳过条件配置对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWflStepskipByIds(String ids) {
        return wflStepskipMapper.deleteWflStepskipByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除流程节点跳过条件配置信息
     *
     * @param conditionId 流程节点跳过条件配置ID
     * @return 结果
     */
    @Override
    public int deleteWflStepskipById(Long conditionId) {
        return wflStepskipMapper.deleteWflStepskipById(conditionId);
    }
}
